<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:31:"./themes/admin/money\index.html";i:1761201295;s:50:"D:\NEW_CODE\edu_student\src\themes\admin\base.html";i:1760177247;}*/ ?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title><?php echo (isset($site_config['site_title']) && ($site_config['site_title'] !== '')?$site_config['site_title']:''); ?></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <link rel="stylesheet" href="/public/static/js/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/public/static/css/font-awesome.min.css">
    <!--CSS引用-->
    
    <link rel="stylesheet" href="/public/static/css/admin.css">
</head>
<body>
<div class="layui-layout layui-layout-admin">
    <!--头部-->
    <div class="layui-header header">
        <!--<img class="logo" src="/public/static/images/admin_logo.png" alt="">-->
        <div class="admin-login"><?php echo (isset($site_config['site_title']) && ($site_config['site_title'] !== '')?$site_config['site_title']:''); ?></div>
        <ul class="layui-nav" style="position: absolute;top: 0;right: 20px;background: none;">
            <li class="layui-nav-item"><a href="<?php echo url('/'); ?>" target="_blank">前台首页</a></li>
            <li class="layui-nav-item"><a href="" data-url="<?php echo url('admin/system/clear'); ?>" id="clear-cache">清除缓存</a></li>
            <li class="layui-nav-item">
                <a href="javascript:;"><?php echo session('admin_name'); ?></a>
                <dl class="layui-nav-child"> <!-- 二级菜单 -->
                    <dd><a href="<?php echo url('admin/change_password/index'); ?>">修改密码</a></dd>
                    <dd><a href="<?php echo url('admin/login/logout'); ?>">退出登录</a></dd>
                </dl>
            </li>
        </ul>
    </div>

    <!--侧边栏-->
    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <ul class="layui-nav layui-nav-tree">
                <li class="layui-nav-item">
                    <a href="<?php echo url('admin/index/index'); ?>"><i class="fa fa-home"></i> 起始页</a>
                </li>
                <?php if(is_array($menu) || $menu instanceof \think\Collection || $menu instanceof \think\Paginator): if( count($menu)==0 ) : echo "" ;else: foreach($menu as $key=>$vo): if(isset($vo['children'])): ?>
                <li class="layui-nav-item">
                    <a href="javascript:;"><i class="<?php echo $vo['icon']; ?>"></i> <?php echo $vo['title']; ?></a>
                    <dl class="layui-nav-child">
                        <?php if(is_array($vo['children']) || $vo['children'] instanceof \think\Collection || $vo['children'] instanceof \think\Paginator): if( count($vo['children'])==0 ) : echo "" ;else: foreach($vo['children'] as $key=>$v): ?>
                        <dd><a href="<?php echo url($v['name']); ?>"> <?php echo $v['title']; ?></a></dd>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </dl>
                </li>
                <?php else: ?>
                <li class="layui-nav-item">
                    <a href="<?php echo url($vo['name']); ?>"><i class="<?php echo $vo['icon']; ?>"></i> <?php echo $vo['title']; ?></a>
                </li>
                <?php endif; endforeach; endif; else: echo "" ;endif; ?>

                <li class="layui-nav-item" style="height: 30px; text-align: center"></li>
            </ul>
        </div>
    </div>

    <!--主体-->
    
<div class="layui-body">
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class="layui-this">学费管理</li>
        </ul>
        <div class="layui-tab-content">

            <form id="form" class="layui-form layui-form-pane" action="<?php echo url('admin/money/index'); ?>" method="get">
                <div class="layui-inline">
                    <label class="layui-form-label">班级</label>
                    <div class="layui-input-inline">
                        <select name="class_id">
                            <option value="0">全部</option>
                            <?php if(is_array($class_list) || $class_list instanceof \think\Collection || $class_list instanceof \think\Paginator): if( count($class_list)==0 ) : echo "" ;else: foreach($class_list as $key=>$vo): if(($vo['id'] == $class_id)): ?>
                            <option value="<?php echo $vo['id']; ?>" selected><?php echo $vo['class_name']; ?></option>
                            <?php else: ?>
                            <option value="<?php echo $vo['id']; ?>"><?php echo $vo['class_name']; ?></option>
                            <?php endif; endforeach; endif; else: echo "" ;endif; ?>
                        </select>
                    </div>
                </div>

                <div class="layui-inline">
                    <label class="layui-form-label">支付状态</label>
                    <div class="layui-input-inline">
                        <select name="status">
                            <option value="-1">全部</option>
                            <option value="0" <?php if($status == 0): ?>selected<?php endif; ?>>未支付</option>
                            <option value="1" <?php if($status == 1): ?>selected<?php endif; ?>>已支付</option>
                        </select>
                    </div>
                </div>

                <div class="layui-inline">
                    <label class="layui-form-label">姓名</label>
                    <div class="layui-input-inline">
                        <input type="text" name="name" value="<?php echo $name; ?>" placeholder="请输入姓名" class="layui-input">
                    </div>
                </div>

                <div class="layui-inline">
                    <label class="layui-form-label">手机号</label>
                    <div class="layui-input-inline">
                        <input type="text" name="phone" value="<?php echo $phone; ?>" placeholder="请输入手机号" class="layui-input">
                    </div>
                </div>

                <div class="layui-inline">
                    <label class="layui-form-label">身份证</label>
                    <div class="layui-input-inline">
                        <input type="text" name="id_card" value="<?php echo $id_card; ?>" placeholder="请输入身份证" class="layui-input">
                    </div>
                </div>

                <div class="layui-inline">
                    <button class="layui-btn">搜索</button>
                </div>
            </form>
            <hr>
            <form action="" method="post" class="ajax-form">
                <div class="layui-tab-item layui-show">
                    <table class="layui-table">
                        <thead>
                        <tr>
                            <th style="width: 10px;">ID</th>
                            <th style="width: 50px;">姓名</th>
                            <th style="width: 50px;">手机</th>
                            <th style="width: 50px;">身份证</th>
                            <th style="width: 50px;">班级</th>
                            <th style="width: 50px;">金额</th>
                            <th style="width: 50px;">状态</th>
                            <th style="width: 50px;">交费时间</th>
                            <th style="width: 100px;">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php if(is_array($money_list) || $money_list instanceof \think\Collection || $money_list instanceof \think\Paginator): $i = 0; $__LIST__ = $money_list;if( count($__LIST__)==0 ) : echo "暂时没有数据" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
                        <tr>
                            <td><?php echo $vo['id']; ?></td>
                            <td><?php echo $vo['name']; ?></td>
                            <td><?php echo $vo['phone']; ?></td>
                            <td><?php echo $vo['id_card']; ?></td>
                            <td><?php echo $vo['class_name']; ?></td>
                            <td><?php echo $vo['prac_amount']; ?></td>
                            <td>
                                <?php if($vo['status'] == 0): ?>
                                <span style="color: #FF5722;">未支付</span>
                                <?php endif; if($vo['status'] == 1): ?>
                                <span style="color: #5FB878;">已支付</span>
                                <?php endif; ?>
                            </td>
                            <td>
                                <?php if(mb_strlen($vo['update_time']) > 0): ?>
                                <?php echo $vo['update_time']; else: ?>
                                --
                                <?php endif; ?>
                            </td>
                            <td>
                                <a href="javascript:;" onclick="pay('<?php echo $vo['id']; ?>','<?php echo $vo['name']; ?>','<?php echo $vo['phone']; ?>','<?php echo $vo['id_card']; ?>')"
                                   class="layui-btn layui-btn-normal layui-btn-mini">交费</a>
                                <a href="javascript:;" onclick="print()"
                                   class="layui-btn layui-btn-warm layui-btn-mini">打印</a>
                            </td>
                        </tr>
                        <?php endforeach; endif; else: echo "暂时没有数据" ;endif; ?>
                        </tbody>
                    </table>
                    <!--分页-->
                    <?php echo $money_list->render(); ?>
                </div>
            </form>
        </div>
    </div>
</div>


    <!--底部-->
    <div class="layui-footer footer">
        <div class="layui-main">
            <p>2016-2017 &copy; <a href="#"><?php echo (isset($site_config['site_title']) && ($site_config['site_title'] !== '')?$site_config['site_title']:''); ?></a></p>
        </div>
    </div>
</div>

<script>
    // 定义全局JS变量
    var GV = {
        current_controller: "admin/<?php echo (isset($controller) && ($controller !== '')?$controller:''); ?>/",
        base_url: "/public/static"
    };
</script>
<!--JS引用-->
<script src="/public/static/js/jquery.min.js"></script>
<script src="/public/static/js/layui/lay/dest/layui.all.js"></script>
<script src="/public/static/js/admin.js"></script>

<!--页面JS脚本-->

<script>
    function pay(id, name, phone, id_card){
        layer.open({
            type: 1,
            skin: 'open-class',
            title:[name + '/' + phone + '/' + id_card, 'font-size:18px;'],
            area: ['500px', '200px'],
            content: '<input id="prac_amount" name="prac_amount" oninput="filterNumbers(this)" placeholder="请输入交费金额" value="" class="layui-input" />',
            btn: ['确定'],
            yes: function(index, layero){
                var prac_amount = $('#prac_amount').val();
                var data = {
                    'prac_amount' : prac_amount,
                    'id' : id
                };
                if (prac_amount > 0) {
                    $.post('<?php echo url("pay"); ?>', data, function(info) {
                        if (info.code === 1) {
                            setTimeout(function () {
                                location.href = info.url;
                            }, 1000);
                            layer.msg(info.msg);
                        } else {
                            layer.msg(info.msg, {icon: 5});
                        }
                    }, 'json');
                }
            },
        });
    }

    function filterNumbers(input) {
        input.value = input.value.replace(/[^\d.]/g, '');
    }

    function down_excel(){
        var formData = $("#form").serialize();
        var url = '<?php echo url("excel"); ?>' + "?" + formData;
        window.open(url, '_blank');
    }

    function print(){
        alert('暂未开发！');
    }

</script>

</body>
</html>